home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / Installing Fonts / InstallFontByStrike.r < prev   
Encoding:
Text File  |  1993-06-15  |  25.0 KB  |  654 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.4 sample: installing a font resource into the appropriate place
  6.  *
  7.  *    File:        InstallFontByStrike.r -    Rez Source
  8.  *
  9.  *    by:            Rich Kubota
  10.  *    modified:    12/1/92 rrk Include sample action atom to check for system 7.1 and
  11.  *                            pre 7.1 system file.
  12.  *                3/22/93 rrk Corrected the sample to install to the Times files
  13.  *                            instead of the New York font file.
  14.  *
  15.  *    Copyright © 1991 Apple Computer, Inc.
  16.  *    All rights reserved.
  17.  *
  18.  *------------------------------------------------------------------------------
  19.  * This sample installs the "Times" font resource, supplied with System 7.0.1, into
  20.  * the appropriate place: the Font Folder under System 7.1 or into the System file
  21.  * for System 7.0.1 and earlier.  This sample demonstrate the use of the 'inff' 
  22.  * Font Family Resource Atom using the 'ExplicitFamilyMemebers' option.
  23.  * It allows for custom installation of fonts.
  24.  *
  25.  * Note: For installation under System 7.1, the script needs to install the font into
  26.  * the Font folder by using the new Folder Manager designator 'font'.  This means that
  27.  * the script needs to determine which system is present and act accordingly.  The font
  28.  * resource can still be installed directly into the 7.1 System file.  Under 7.1, it is
  29.  * preferable to install fonts to the Font folder.  Fonts installed into the System file
  30.  * have priority use in case of name conflicts.
  31.  *
  32.  * The reverse issue of installing fonts into the Fonts folder under 7.0.1 and earlier
  33.  * IS a problem.  In such case, fonts will not be recognized.  Easy install rules
  34.  * help to keep the user from installing the font in the wrong place.  For custom
  35.  * installation, this script includes a pre-installation action
  36.  * atom to check the version of the System file, should the 7.1 font package be selected.
  37.  * If the system is earlier, the code resource alerts the user that the target
  38.  * volume has an incompatible system for installing fonts to the Font folder.  
  39.  * Unfortunately, Installer 3.4 installs fonts to the Font folder if the "special-font"
  40.  * designator is used for System 7.0.1.
  41.  * 
  42.  * Conversely, a second action atom is included to check whether the pre7.1 font
  43.  * package has been selected, but the target system is 7.1 or greater.  Without this
  44.  * check, the Installer (3.3/3.4) would install fonts to the System file.  This is
  45.  * not as critical an error as the reverse case described above.  Font strikes installed
  46.  * to the System file will have priority over those installed to the Fonts folder.
  47.  *
  48.  * IMPORTANT NOTE:  There exists a known BUG with Installer v3.4 when installing
  49.  * font resources.  This problem is fixed with Installer 3.4.3.
  50.  *
  51.  * The problem occurs when a font resource already exists on a 
  52.  * System 7.0.1 or earlier system with the same ID as the one to be installed, BUT
  53.  * with a different name.  Under such situation, the Installer remaps the new FOND 
  54.  * ID as it should, however the remapping begins with ID 0.  This normally results
  55.  * in a remap to FOND ID 1 - a System reserved FOND ID.  The result is that the
  56.  * font will never be recognized.  We have not found this problem to corrupt the
  57.  * System.  
  58.  *----------------------------------------------------------------------------*/
  59.  
  60. #ifdef INSTRUCTIONS
  61.  
  62.  
  63. # To create the installation disk
  64. # 1. Name the floppy disk "Font Installer".
  65. # 2. Copy Installer 3.4 onto the floppy.
  66. # 3. Copy the Times font suitcase supplied in System 7.1 to the floppy.
  67. # 4. Use ResEdit to create a new resource file "Times_snft"
  68.         For the DevCD release of this sample, use the supplied files and disregard
  69.         the remaining instructions.
  70. # 5. Open the Times font suitcase on the floppy and copy the 4 'sfnt' resources
  71.         There should be 4 resources for Times, Times Bold, Times Italic, and 
  72.         Times Bold Italic.
  73. # 6. Paste these four resources into the "Times_sfnt" file and save it.
  74. # 7. place the file "Times_sfnt" onto the root level of the floppy "Font Installer"
  75. # 8. Rez and ScriptCheck 3.4b2 this script, and copy to the floppy.
  76. # 9. If ScriptCheck complains, it's because the resource sizes of the copied
  77.         'sfnt' resources don't exactly match the resource sizes used, or the
  78.         names of the resources don't match, or the ID numbers have been altered.
  79.  
  80.  
  81. # You can build and complete the script with the following lines:
  82. #    Note: set up floppies with the appropriate names and contents before running scriptcheck
  83. #    or set up folders with the same names and contents as the floppies
  84. #    put these folders in the same folder as the script or at the root directory of same disk
  85.  
  86.     rez -o "InstallFontByStrike Script" -t 'bbkr' -c 'bbkr' "InstallFontByStrike.r"
  87.     setfile -a i "InstallFontByStrike Script"        #mark Inited
  88.     scriptcheck -p "InstallFontByStrike Script"
  89. #endif
  90.     
  91. #include "Types.r"                    /* for the ICON resource */
  92. #include "InstallerTypes.r"
  93. #include "InstallerCommon.r"        /* file of some common defines */
  94. #include "CheckTgtSysVer.h"
  95.  
  96.  
  97. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  98. #define kDateNotChecked        0
  99. #define kTimesBitFontSize    32030        /* approximate size of bit-mapped fonts */
  100. #define kTimesTrueFontSize    255970      /* approximate size of true type fonts */
  101. #define kTimesFontSize        288000      /* approximate size of font suitcase + buffer */
  102.                                 /* This figure is derived from the Times font supplied */
  103.                                 /* with System 7.1. */
  104.  
  105. /* Definitions for the rules */
  106. #define fontRule71            1000
  107. #define fontRulePre71        1001
  108. #define noSystem            1002
  109.  
  110. /* Defines for the file spec atoms.  These are specifications for source and destination files */
  111. #define fsSourceFont        2000
  112. #define fsTargetSystem        2001
  113. #define fsTargetFontFolder    2002
  114. #define    fsAltSourceFont        2003
  115.  
  116. /* This is the name of the source disk */
  117. #define FontDisk "Font Installer:"
  118.  
  119. /* where we want to install our Font. */
  120. #define TargetPath71 "special-font:"    /* Indicate that we want to install the font to
  121.                                         the Font folder for System 7.1.
  122.                                     */
  123. #define TargetPathPre71 "special-macs:"    /* Indicate that we want to install the font to
  124.                                         the System file for System 7.0.1 and ealier.
  125.                                     */
  126.  
  127. /* Definition for the packages. */
  128. #define pkTheFont71            3000
  129. #define pkTheFontPre71        3001
  130.  
  131. /* Definition for the font resource atom. */
  132. #define ffBitFont71            4000        /* inff resource for the bitmapped fonts */
  133. #define ffTrueFont71        4001        /* inff resource for the true type fonts */
  134. #define ffBitFontPre71        4002
  135. #define ffTrueFontPre71        4003
  136.  
  137. /* Definition for the package comment resource */
  138. #define cmtTheFont71        5000
  139. #define cmtTheFontPre71        5001
  140. #define iconTheFont            6000
  141.  
  142. /* Definitions for the action atom resources */
  143. #define aaCheckFor71        7000
  144. #define aaCheckForPre71        7001
  145.  
  146. /* 'inaa' code resource definition */
  147. #define        aaCodeID        10000
  148.  
  149. /* December 1, 1992 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  150. /* this value to a LongInt seconds value needed by the Installer. */
  151. #define currentReleaseDate    12011992        
  152. #define currentVersion        102     /* Version 1.0.2 goes in the 'icmt' rsrc */
  153.  
  154.  
  155. /************************** Easy Install Rule resources **********************************/
  156. resource 'infr' (1) {
  157.     format0  {{
  158.         pickFirst,    {fontRule71, fontRulePre71, noSystem}     /* Select the Font rule */
  159.     }};
  160. };
  161.  
  162. resource 'inrl' (fontRule71) {
  163.     format0 {{
  164.         checkFileVersion{fsTargetSystem, 7, 0x10, release, 0},
  165.         addUserDescription {"Click Install button to install\n"},    
  166.                                             /* message to appear in Easy Install screen */
  167.         addUserDescription {"• the Times Font in the Font Folder\n"}, /* 2nd line of message */
  168.         addPackages {{pkTheFont71}}            /* installing the font package */
  169.     }};
  170. };
  171.  
  172. resource 'inrl' (fontRulePre71) {
  173.     format0 {{
  174.         checkFileVersion{fsTargetSystem, 0, 0x0, release, 0},
  175.         addUserDescription {"Click Install button to install\n"},    
  176.                                             /* message to appear in Easy Install screen */
  177.         addUserDescription {"• the Times Font into the System File\n"}, /* 2nd line of message */
  178.         addPackages {{pkTheFontPre71}}        /* installing the font package */
  179.     }};
  180. };
  181.  
  182. resource 'inrl' (noSystem) {
  183.     format0 {{
  184.         reportVolError {"There is no System on volume ^0."},
  185.     }};
  186. };
  187.  
  188. /***************************** Package Resources ************************************************/
  189. resource 'inpk' (pkTheFont71)     {    /* This package could include other atoms */
  190.     format0 {
  191.         showsOnCustom,                 /* Package appears in the Custom Install display */
  192.         removable,                    /* Package can be removed */
  193.         dontForceRestart,            /* not necessary to reboot in this case */
  194.         cmtTheFont71,                 /* package's 'icmt' resource id */
  195.         kTimesFontSize,                /* Package size must be entered manually */
  196.                                     /* ScriptCheck wont do this for us.  Note, make sure you
  197.                                         use ScriptCheck v3.4b2 or greater.  
  198.                                     */
  199.         "Install Times Font for Sys 7.1", { /* package name for package that shows on custom */
  200.             'inaa', aaCheckFor71,
  201.             'inff', ffBitFont71,
  202.             'inff', ffTrueFont71,
  203.         }
  204.     }
  205. };
  206.  
  207. resource 'inpk' (pkTheFontPre71) {    /* This package could include other atoms */
  208.     format0 {
  209.         showsOnCustom,                 /* Package appears in the Custom Install display */
  210.         removable,                    /* Package can be removed */
  211.         dontForceRestart,            /* not necessary to reboot in this case */
  212.         cmtTheFontPre71,             /* package's 'icmt' resource id */
  213.         kTimesFontSize,                /* Package size must be entered manually */
  214.                                     /* ScriptCheck wont do this for us.  Note, make sure you
  215.                                         use ScriptCheck v3.4b2 or greater.  
  216.                                     */
  217.         "Install Times Font for Sys 7.0.1 and earlier", { /* package name for package that shows on custom */
  218.             'inaa', aaCheckForPre71,
  219.             'inff', ffBitFontPre71,
  220.             'inff', ffTrueFontPre71,
  221.         }
  222.     }
  223. };
  224.  
  225. /***************************** Comments ************************************************/
  226. resource 'icmt' (cmtTheFont71) {
  227.     currentReleaseDate,
  228.     currentVersion,
  229.     iconTheFont,
  230.     "This package installs the Times Font into the System 7.1 Font Folder. "
  231. };
  232.  
  233. resource 'icmt' (cmtTheFontPre71) {
  234.     currentReleaseDate,
  235.     currentVersion,
  236.     iconTheFont,
  237.     "This package installs the Times Font into the System File for System 7.0.1 and earlier."
  238. };
  239.  
  240. resource 'ICON' (iconTheFont) {
  241.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  242.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  243.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  244.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  245.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  246.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  247.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  248.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  249. };
  250.  
  251.  
  252.  
  253. /********************************************* File Specs *******************************************/
  254. /* Source File Specs */
  255. resource 'infs' (fsSourceFont) {
  256.     'FFIL',                                /* File Type */
  257.     'DMOV',                                /* Creator */
  258.     kDateNotChecked,                    /* ScriptCheck fills in the creation date */
  259.     noSearchForFile,                    /* Do not search the source disk for the file */
  260.     typeCrMustMatch,                    /* file type and creator on source disk must match */
  261.     FontDisk"Times"                        /* Path to the file */
  262. };
  263.  
  264. resource 'infs' (fsAltSourceFont) {
  265.     'rsrc',                                /* File Type */
  266.     'RSED',                                /* Creator */
  267.     kDateNotChecked,                    /* ScriptCheck fills in the creation date */
  268.     noSearchForFile,                    /* Do not search the source disk for the file */
  269.     typeCrMustMatch,                    /* file type and creator on source disk must match */
  270.     FontDisk"Times_sfnt"                /* Path to the file */
  271. };
  272.  
  273. resource 'infs' (fsTargetSystem) {
  274.     'ZSYS',                                /* File Type */
  275.     'MACS',                                /* Creator */
  276.     kDateNotChecked,                                    /* creation date not needed for target file specs */
  277.     noSearchForFile,                    /* Do not search the target disk for the file */
  278.     typeCrNeedNotMatch,                    /* match system 6 or 7 */
  279.     TargetPathPre71"System"                /* destination Path */
  280. };
  281.  
  282. resource 'infs' (fsTargetFontFolder) {
  283.     'FFIL',                                /* File Type */
  284.     'DMOV',                                /* Creator */
  285.     kDateNotChecked,                                    /* creation date not needed for target file specs */
  286.     noSearchForFile,                    /* Do not search the target disk for the file */
  287.     typeCrNeedNotMatch,                    /* match system 6 or 7 */
  288.     TargetPath71"Times"                    /* destination Path */
  289. };
  290.  
  291. /*************************************** Font Family Atoms **********************************************/
  292. resource 'inff' (ffBitFont71) {
  293.     format0 {
  294.         StdFontMake,                    /* see InstallerCommon.r for #define */
  295.         fsTargetFontFolder,                /* Target file spec to install rsrc into */
  296.         fsSourceFont,                    /* Source file spec where to get rsrc */
  297.         0x20,                            /* 'FOND' is purgeable */
  298.         kTimesBitFontSize,                /* font resource size entered manually */
  299.         20,                                /* Resource ID of Times 'FOND' */
  300.         explicitFamilyMembers {{        /* install the following strikes */
  301.             /* [1] */
  302.             9,                            /* point size */
  303.             PlainFontStyle,                /* plain font style */
  304.             'NFNT',                        /* Target Font Res Type */
  305.             32,                            /* Target resource attributes - 32 = resPurgeable */
  306.             {},                            /* resource contained in source file */
  307.                 
  308.             /* [2] */
  309.             10,                            /* point size */
  310.             PlainFontStyle,                /* plain font style */
  311.             'NFNT',                        /* Target Font Res Type */
  312.             32,                            /* Target resource attributes - 32 = resPurgeable */
  313.             {},                            /* resource contained in source file */
  314.  
  315.             /* [3] */
  316.             12,                            /* point size */
  317.             PlainFontStyle,                /* plain font style */
  318.             'NFNT',                        /* Target Font Res Type */
  319.             32,                            /* Target resource attributes - 32 = resPurgeable */
  320.             {},                            /* resource contained in source file */
  321.  
  322.             /* [4] */
  323.             14,                            /* point size */
  324.             PlainFontStyle,                /* plain font style */
  325.             'NFNT',                        /* Target Font Res Type */
  326.             32,                            /* Target resource attributes - 32 = resPurgeable */
  327.             {},                            /* resource contained in source file */
  328.  
  329.             /* [5] */
  330.             18,                            /* point size */
  331.             PlainFontStyle,                /* plain font style */
  332.             'NFNT',                        /* Target Font Res Type */
  333.             32,                            /* Target resource attributes - 32 = resPurgeable */
  334.             {},                            /* resource contained in source file */
  335.  
  336.             /* [6] */
  337.             24,                            /* point size */
  338.             PlainFontStyle,                /* plain font style */
  339.             'NFNT',                        /* Target Font Res Type */
  340.             32,                            /* Target resource attributes - 32 = resPurgeable */
  341.             {}                            /* resource contained in source file */
  342.  
  343.         }},
  344.         "Times Font",                    /* Atom description */
  345.         "Times"                            /* Font Resource name */
  346.     };
  347. };
  348.  
  349. resource 'inff' (ffTrueFont71) {
  350.     format0 {
  351.         StdFontMake,                    /* see InstallerCommon.r for #define */
  352.         fsTargetFontFolder,                /* Target file spec to install rsrc into */
  353.         fsSourceFont,                    /* Source file spec where to get rsrc */
  354.         0x20,                            /* 'FOND' is purgeable */
  355.         kTimesTrueFontSize,                /* font resource size entered manually */
  356.         20,                                /* Resource ID of Times 'FOND' */
  357.         explicitFamilyMembers {{        /* install the following strikes */
  358.  
  359.             /* [1] */
  360.             0,                            /* point size - 0 indicates TrueType font*/
  361.             PlainFontStyle,                /* plain font style */
  362.             'sfnt',                        /* Target Font Res Type */
  363.             32,                            /* Target resource attributes - 32 = resPurgeable */
  364.             {                            /* array Parts: 1 element */
  365.                 /* [1] */
  366.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  367.                 'sfnt',                    /* resource type in alternate file */
  368.                 18589,                    /* resource ID in alternate file */
  369.                 63976,                    /* resource size must be exact */
  370.                 "Times",                /* Name of this resource must match that of the resource */
  371.             },
  372.  
  373.             /* [2] */
  374.             0,                            /* point size - 0 indicates TrueType font*/
  375.             BoldFontStyle,                /* bold font style */
  376.             'sfnt',                        /* Target Font Res Type */
  377.             32,                            /* Target resource attributes - 32 = resPurgeable */
  378.             {                            /* array Parts: 1 element */
  379.                 /* [1] */
  380.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  381.                 'sfnt',                    /* resource type in alternate file */
  382.                 6305,                    /* resource ID in alternate file */
  383.                 62212,                    /* resource size must be exact */
  384.                 "Times Bold",            /* Name of this resource must match that of the resource */
  385.             },
  386.  
  387.             /* [3] */
  388.             0,                            /* point size - 0 indicates TrueType font*/
  389.             ItalicFontStyle,            /* italic font style */
  390.             'sfnt',                        /* Target Font Res Type */
  391.             32,                            /* Target resource attributes - 32 = resPurgeable */
  392.             {                            /* array Parts: 1 element */
  393.                 /* [1] */
  394.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  395.                 'sfnt',                    /* resource type in alternate file */
  396.                 6466,                    /* resource ID in alternate file */
  397.                 65408,                    /* resource size must be exact */
  398.                 "Times Italic"            /* Name of this resource must match that of the resource */
  399.             },
  400.  
  401.             /* [4] */
  402.             0,                            /* point size - 0 indicates TrueType font*/
  403.             BoldItalicFontStyle,        /* bold italic font style */
  404.             'sfnt',                        /* Target Font Res Type */
  405.             32,                            /* Target resource attributes - 32 = resPurgeable */
  406.             {                            /* array Parts: 1 element */
  407.                 /* [1] */
  408.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  409.                 'sfnt',                    /* resource type in alternate file */
  410.                 6966,                    /* resource ID in alternate file */
  411.                 64276,                    /* resource size must be exact */
  412.                 "Times Bold Italic",    /* Name of this resource must match that of the resource */
  413.             }
  414.  
  415. #ifdef COMMENT                    
  416.             /* Notes: If the font resource were so big that the single resource could not fit
  417.                 on a single floppy, then the font resource might be broken up into several
  418.                 resources on separate files.  As such, you might have the following sample
  419.                 array parts declaration.  Note that the resource type can be changed to some 
  420.                 new type.  For the following case fsAltSourceFont# is the source file spec where
  421.                 the resource 'part' will be found.  The Installer already knows that the target
  422.                 font resource will be installed per the target file spec listed above.  The 
  423.                 partial resources will be assembled together in the order listed to create the
  424.                 font strike specified by the enclosing strike description (in this case the Times
  425.                 TrueType Font - plain). 
  426.             */
  427.                         
  428.                         
  429.             {    /* array Parts: 4 elements */
  430.                 /* [1] */
  431.                 fsAltSourceFont1, 'part', sourceFontID1, 1359872, "part 1 of font resource",
  432.                 /* [2] */
  433.                 fsAltSourceFont2, 'part', sourceFontID2, 1359872, "part 2 of font resource",
  434.                 /* [3] */
  435.                 fsAltSourceFont3, 'part', sourceFontID3, 1359872, "part 3 of font resource",
  436.                 /* [4] */
  437.                 fsAltSourceFont4, 'part', sourceFontID4, 915220, "part 4 of font resource"
  438.             }
  439. #endif
  440.                         
  441.         }},
  442.         "Times Font",                    /* Atom description */
  443.         "Times"                            /* Font Resource name */
  444.     };
  445. };
  446.  
  447. resource 'inff' (ffBitFontPre71) {
  448.     format0 {
  449.         StdFontCopy,                    /* See InstallerCommon.r for #define */
  450.         fsTargetSystem,                    /* Target file spec to install rsrc into */
  451.         fsSourceFont,                    /* Source file spec where to get rsrc */
  452.         0x20,                            /* 'FOND' is purgeable */
  453.         kTimesBitFontSize,                /* font resource size entered manually */
  454.         20,                                /* Resource ID of Times 'FOND' */
  455.         explicitFamilyMembers {{        /* install the following strikes */
  456.             /* [1] */
  457.             9,                            /* point size */
  458.             PlainFontStyle,                /* plain font style */
  459.             'NFNT',                        /* Target Font Res Type */
  460.             32,                            /* Target resource attributes - 32 = resPurgeable */
  461.             {},                            /* resource contained in source file */
  462.                 
  463.             /* [2] */
  464.             10,                            /* point size */
  465.             PlainFontStyle,                /* plain font style */
  466.             'NFNT',                        /* Target Font Res Type */
  467.             32,                            /* Target resource attributes - 32 = resPurgeable */
  468.             {},                            /* resource contained in source file */
  469.  
  470.             /* [3] */
  471.             12,                            /* point size */
  472.             PlainFontStyle,                /* plain font style */
  473.             'NFNT',                        /* Target Font Res Type */
  474.             32,                            /* Target resource attributes - 32 = resPurgeable */
  475.             {},                            /* resource contained in source file */
  476.  
  477.             /* [4] */
  478.             14,                            /* point size */
  479.             PlainFontStyle,                /* plain font style */
  480.             'NFNT',                        /* Target Font Res Type */
  481.             32,                            /* Target resource attributes - 32 = resPurgeable */
  482.             {},                            /* resource contained in source file */
  483.  
  484.             /* [5] */
  485.             18,                            /* point size */
  486.             PlainFontStyle,                /* plain font style */
  487.             'NFNT',                        /* Target Font Res Type */
  488.             32,                            /* Target resource attributes - 32 = resPurgeable */
  489.             {},                            /* resource contained in source file */
  490.  
  491.             /* [6] */
  492.             24,                            /* point size */
  493.             PlainFontStyle,                /* plain font style */
  494.             'NFNT',                        /* Target Font Res Type */
  495.             32,                            /* Target resource attributes - 32 = resPurgeable */
  496.             {}                            /* resource contained in source file */
  497.  
  498.         }},
  499.         "Times Font",                    /* Atom description */
  500.         "Times"                            /* Font Resource name */
  501.     };
  502. };
  503.  
  504. resource 'inff' (ffTrueFontPre71) {
  505.     format0 {
  506.         StdFontCopy,                    /* See InstallerCommon.r for #define */
  507.         fsTargetSystem,                    /* Target file spec to install rsrc into */
  508.         fsSourceFont,                    /* Source file spec where to get rsrc */
  509.         0x20,                            /* 'FOND' is purgeable */
  510.         kTimesTrueFontSize,                /* font resource size entered manually */
  511.         20,                                /* Resource ID of Times 'FOND' */
  512.         explicitFamilyMembers {{        /* install the following strikes */
  513.             /* [1] */
  514.             0,                            /* point size - 0 indicates TrueType font*/
  515.             PlainFontStyle,                /* plain font style */
  516.             'sfnt',                        /* Target Font Res Type */
  517.             32,                            /* Target resource attributes - 32 = resPurgeable */
  518.             {                            /* array Parts: 1 element */
  519.                 /* [1] */
  520.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  521.                 'sfnt',                    /* resource type in alternate file */
  522.                 18589,                    /* resource ID in alternate file */
  523.                 63976,                    /* resource size must be exact */
  524.                 "Times",                /* Name of this resource must match that of the resource */
  525.             },
  526.             /* [2] */
  527.             0,                            /* point size - 0 indicates TrueType font*/
  528.             BoldFontStyle,                /* bold font style */
  529.             'sfnt',                        /* Target Font Res Type */
  530.             32,                            /* Target resource attributes - 32 = resPurgeable */
  531.             {                            /* array Parts: 1 element */
  532.                 /* [1] */
  533.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  534.                 'sfnt',                    /* resource type in alternate file */
  535.                 6305,                    /* resource ID in alternate file */
  536.                 62212,                    /* resource size must be exact */
  537.                 "Times Bold",            /* Name of this resource must match that of the resource */
  538.             },
  539.             /* [3] */
  540.             0,                            /* point size - 0 indicates TrueType font*/
  541.             ItalicFontStyle,            /* italic font style */
  542.             'sfnt',                        /* Target Font Res Type */
  543.             32,                            /* Target resource attributes - 32 = resPurgeable */
  544.             {                            /* array Parts: 1 element */
  545.                 /* [1] */
  546.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  547.                 'sfnt',                    /* resource type in alternate file */
  548.                 6466,                    /* resource ID in alternate file */
  549.                 65408,                    /* resource size must be exact */
  550.                 "Times Italic",            /* Name of this resource must match that of the resource */
  551.             },
  552.             /* [4] */
  553.             0,                            /* point size - 0 indicates TrueType font*/
  554.             BoldItalicFontStyle,        /* bold italic font style */
  555.             'sfnt',                        /* Target Font Res Type */
  556.             32,                            /* Target resource attributes - 32 = resPurgeable */
  557.             {                            /* array Parts: 1 element */
  558.                 /* [1] */
  559.                 fsAltSourceFont,        /* source file spec of resource if from different file */
  560.                 'sfnt',                    /* resource type in alternate file */
  561.                 6966,                    /* resource ID in alternate file */
  562.                 64276,                    /* resource size must be exact */
  563.                 "Times Bold Italic",    /* Name of this resource must match that of the resource */
  564.             }
  565.         }},
  566.         "Times Font",                    /* Atom description */
  567.         "Times"                            /* Font Resource name */
  568.     };
  569. };
  570.  
  571. /******************************************** Action Atoms ************************************************/
  572.  
  573. resource 'inaa'    (aaCheckFor71) {
  574.     format1 {
  575.         suspendBusyCursors,                /* go back to arrow cursor should alert happen */
  576.         actBefore,                        /* act before the installation occurs */
  577.         dontActOnRemove,                /* dont need to be called on remove */
  578.         actOnInstall,                    /* get called on installation */
  579.         'infn',                            /* code resource type */
  580.         aaCodeID,                        /* code resource ID */
  581.         kSys71,                            /* check for System 7.1 or greater */
  582.         ""
  583.     }
  584. };
  585.  
  586. resource 'inaa'    (aaCheckForPre71) {
  587.     format1 {
  588.         suspendBusyCursors,                /* go back to arrow cursor should alert happen */
  589.         actBefore,                        /* act before the installation occurs */
  590.         dontActOnRemove,                /* dont need to be called on remove */
  591.         actOnInstall,                    /* get called on installation */
  592.         'infn',                            /* code resource type */
  593.         aaCodeID,                        /* code resource ID */
  594.         kSysPre71,                        /* check for System 7.1 or greater */
  595.         ""
  596.     }
  597. };
  598.  
  599.  
  600.  
  601. /* The following resources are required by the CheckTgtSysVer action atom */
  602.  
  603. resource 'STR#' (kErrStrings, purgeable) {
  604.     {
  605.     "There is no blessed system folder on the target volume.  Aborting font installation.";
  606.     "Cannot install this package to System 7.1 or greater.  Aborting font installation.";
  607.     "This package requires System 7.1 or greater.  Aborting font installation.";
  608.     "Unable to verify system version.  Aborting installation.";
  609.     }
  610. };
  611.  
  612. /* this ALRT and DITL are used as an error screen */
  613.  
  614. resource 'ALRT' (rUserAlert, purgeable) {
  615.     {40, 20, 200, 375},
  616.     rUserAlert,
  617.     { /* array: 4 elements */
  618.         /* [1] */
  619.         OK, visible, silent,
  620.         /* [2] */
  621.         OK, visible, silent,
  622.         /* [3] */
  623.         OK, visible, silent,
  624.         /* [4] */
  625.         OK, visible, silent
  626.     }
  627. };
  628.  
  629.  
  630. resource 'DITL' (rUserAlert, purgeable) {
  631.     { /* array DITLarray: 3 elements */
  632.         /* [1] */
  633.         {130, 270, 150, 350},
  634.         Button {
  635.             enabled,
  636.             "OK"
  637.         },
  638.         /* [2] */
  639.         {10, 60, 120, 350},
  640.         StaticText {
  641.             disabled,
  642.             "Error. ^0."
  643.         },
  644.         /* [3] */
  645.         {8, 8, 40, 40},
  646.         Icon {
  647.             disabled,
  648.             0
  649.         }
  650.     }
  651. };
  652.  
  653. INCLUDE    "CheckTgtSysVer.rsrc" 'infn' (10000) AS 'infn' (aaCodeID, $$Attributes);
  654.